package com.awcall.iot.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 管理员表
 * </p>
 *
 * @author wuhui
 * @since 2018-03-05
 */
@TableName("bd_system_user")
public class SystemUser extends Model<SystemUser> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Integer id;
    /**
     * 用户名
     */
	private String username;
    /**
     * 密码
     */
	private String password;
	@TableField("role_id")
	private Integer roleId;
	private String telephone;
	@TableField("project_id")
	private Integer projectId;
	@TableField("project_name")
	private String projectName;
    /**
     * 状态(0:启用 1:禁用)
     */
	private Integer status;
	@TableField(value = "created_at", fill = FieldFill.INSERT)
	private Date createdAt;
	@TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
	private Date updatedAt;

	@TableField(exist = false)
	private String token;

	@TableField(exist = false)
	private List<Authority> authorityList;

	@TableField(exist = false)
	private String oldPassword;

	@TableField(exist = false)
	private String roleName;

	@TableField(exist = false)
	private String companyName;

	public Integer getProjectId() {
		return projectId;
	}

	public SystemUser setProjectId(Integer projectId) {
		this.projectId = projectId;
		return this;
	}

	public String getProjectName() {
		return projectName;
	}

	public SystemUser setProjectName(String projectName) {
		this.projectName = projectName;
		return this;
	}

	public String getTelephone() {
		return telephone;
	}

	public SystemUser setTelephone(String telephone) {
		this.telephone = telephone;
		return this;
	}

	public String getCompanyName() {
		return companyName;
	}

	public SystemUser setCompanyName(String companyName) {
		this.companyName = companyName;
		return this;
	}

	public String getRoleName() {
		return roleName;
	}

	public SystemUser setRoleName(String roleName) {
		this.roleName = roleName;
		return this;
	}

	public String getOldPassword() {
		return oldPassword;
	}

	public SystemUser setOldPassword(String oldPassword) {
		this.oldPassword = oldPassword;
		return this;
	}

	public List<Authority> getAuthorityList() {
		return authorityList;
	}

	public SystemUser setAuthorityList(List<Authority> authorityList) {
		this.authorityList = authorityList;
		return this;
	}

	public String getToken() {
		return token;
	}

	public SystemUser setToken(String token) {
		this.token = token;
		return this;
	}

	public Integer getId() {
		return id;
	}

	public SystemUser setId(Integer id) {
		this.id = id;
		return this;
	}

	public String getUsername() {
		return username;
	}

	public SystemUser setUsername(String username) {
		this.username = username;
		return this;
	}

	public String getPassword() {
		return password;
	}

	public SystemUser setPassword(String password) {
		this.password = password;
		return this;
	}

	public Integer getRoleId() {
		return roleId;
	}

	public SystemUser setRoleId(Integer roleId) {
		this.roleId = roleId;
		return this;
	}

	public Integer getStatus() {
		return status;
	}

	public SystemUser setStatus(Integer status) {
		this.status = status;
		return this;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public SystemUser setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
		return this;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public SystemUser setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
		return this;
	}

	public static final String ID = "id";

	public static final String USERNAME = "username";

	public static final String PASSWORD = "password";

	public static final String ROLE_ID = "role_id";

	public static final String STATUS = "status";

	public static final String CREATED_AT = "created_at";

	public static final String UPDATED_AT = "updated_at";

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "SystemUser{" +
			", id=" + id +
			", username=" + username +
			", password=" + password +
			", roleId=" + roleId +
			", status=" + status +
			", createdAt=" + createdAt +
			", updatedAt=" + updatedAt +
			"}";
	}
}
